package cn.com.connext.scrm.web.rest.enums;

/**
 * @Description: 订单类型
 * @author: ZHaoYul
 * @date: 2021/4/25 15:39
 */
public enum OrderTypeEnum {
    ORDER_TYPE_10(10, "积分订单"),
    ORDER_TYPE_20(20, "实物订单");
    private int code;
    private String name;

    OrderTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    //根据code 取名称
    public String getName(int code) {
        for (OrderTypeEnum o : OrderTypeEnum.values()){
            if (code == o.getCode()) {
                return o.getName();
            }
        }
       return null;
    }
}
